<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能导诊助手 Ver:1.0dev</title>
    
    <!-- 添加缓存控制元标签 -->
    <meta http-equiv="Cache-Control" content="max-age=31536000, immutable">
    
    <!-- 预加载关键资源 -->
    <link rel="preload" href="js/performance.js" as="script">
    <link rel="preload" href="css/style.css" as="style">
    <link rel="preload" href="js/hospitalService.js" as="script">
    <link rel="preload" href="js/main.js" as="script">
    
    <!-- 添加性能监控脚本 (最先加载) -->
    <script src="js/performance.js"></script>
    
    <!-- 使用国内CDN源替换国外CDN -->
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <link rel="stylesheet" href="css/style.css">
    <!-- 添加内联SVG图标 -->
    <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path fill='%234285f4' d='M544 96H416V32c0-17.7-14.3-32-32-32H192c-17.7 0-32 14.3-32 32v64H32c-17.7 0-32 14.3-32 32v368c0 8.8 7.2 16 16 16h544c8.8 0 16-7.2 16-16V128c0-17.7-14.3-32-32-32zM160 436c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-128c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm160 128c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-128c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm160 128c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm0-128c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm-320 0c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40zm320-160H96v-64c0-17.7 14.3-32 32-32h320c17.7 0 32 14.3 32 32v64z'/></svg>" type="image/svg+xml">
</head>
<body>
    <header>
        <div class="logo">
            <i class="fas fa-hospital"></i>
        </div>
        <div>
            <h1>智能导诊助手</h1>
            <p class="subtitle">
                <!-- 添加外层占位div，确保状态切换时排版稳定 -->
                <div style="display: inline-flex; align-items: center; gap: 10px;">
                    <div style="display: inline-block; min-width: 150px; height: 20px;">
                        <span id="apiStatus" class="status-indicator" style="position: static; display: inline-flex;">
                            <i id="apiStatusIcon" class="fas fa-circle-notch fa-spin"></i>
                            <span id="apiStatusText">检测DeepSeek API...</span>
                        </span>
                    </div>
                    <div style="display: inline-block; min-width: 150px; height: 20px;">
                        <span id="jsonStatus" class="status-indicator" style="position: static; display: inline-flex;">
                            <i id="jsonStatusIcon" class="fas fa-circle-notch fa-spin"></i>
                            <span id="jsonStatusText">加载医院数据...</span>
                        </span>
                    </div>
                </div>
            </p>
        </div>
    </header>
    
    <!-- 原JSON状态指示器位置已删除 -->
    
    <div class="chat-container" id="chatContainer">
        <!-- 初始消息将在JS中添加 -->
    </div>
    
    <div class="input-container">
        <textarea id="userInput" rows="3" placeholder="请描述您的症状或健康问题..."></textarea>
        <button onclick="sendMessage()" aria-label="发送消息" title="发送消息">
            <i class="fas fa-paper-plane"></i>
        </button>
    </div>
    
    <div class="quick-questions" id="quickQuestionsContainer">
        <div class="quick-question" onclick="useQuickQuestion('我最近总是感到头痛，可能是什么原因？')" role="button" tabindex="0" aria-label="快速提问：我最近总是感到头痛">我最近总是感到头痛</div>
        <div class="quick-question" onclick="useQuickQuestion('高血压患者的日常饮食应该注意什么？')" role="button" tabindex="0" aria-label="快速提问：高血压饮食建议">高血压饮食建议</div>
        <div class="quick-question" onclick="useQuickQuestion('感冒发烧应该如何护理？')" role="button" tabindex="0" aria-label="快速提问：感冒发烧护理">感冒发烧护理</div>
        <div class="quick-question" onclick="useQuickQuestion('糖尿病患者应该如何控制血糖？')" role="button" tabindex="0" aria-label="快速提问：糖尿病血糖控制">糖尿病血糖控制</div>
    </div>
    
    <div class="disclaimer">
        <p>免责声明：本助手提供的建议仅供参考，不能替代专业医生的诊断和治疗。如有紧急情况，请立即前往医院就诊。</p>
    </div>

    <!-- 先加载 hospitalService.js -->
    <script src="js/hospitalService.js"></script>
    <!-- 然后加载 main.js -->
    <script src="js/main.js"></script>
    

    
    <!-- 添加性能测试结束标记 -->
    <script>
        window.addEventListener('load', () => {
            PerformanceMonitor.end('页面总加载');
        });
    </script>
</body>
</html>